package edu.zut.main.thread;

public class ThreadJoin {

    public static void main(String[] args) {


        Thread thread = new Thread(new VIPThread());

        thread.start();
        //普通客户在正常排队
        for (int i = 1; i < 100; i++) {
            if (i == 20){
                try {
                    thread.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("普通客户" + i + "该你了");
        }
    }
}

//以银行排队为例，vip可以插队
class VIPThread implements Runnable{

    @Override
    public void run() {
        for (int i = 1; i < 11; i++) {
            System.out.println("VIP-" + i + "-插队");
        }
    }
}



